package com.design.cacheImpl;

import com.design.ICacheService;
import com.design.util.RedisUtil;

import java.util.concurrent.TimeUnit;

/**
 * 缓存操作类
 * @author ytj
 * @date 2021/12/24
 */
public class CacheServiceImpl implements ICacheService {
    RedisUtil redisUtil=new RedisUtil();
    @Override
    public String get(String key) {
        return redisUtil.get(key);
    }

    @Override
    public void set(String key, String value) {
        redisUtil.set(key, value);
    }

    @Override
    public void set(String key, String value, long timeout, TimeUnit timeUnit) {
        redisUtil.set(key, value,timeout,timeUnit);
    }

    @Override
    public void del(String key) {
        redisUtil.del(key);
    }
}
